//
//  ZDSelectListController.m
//  ZDPension
//
//  Created by 刘甲奇 on 2017/6/15.
//  Copyright © 2017年 maker. All rights reserved.
//

#import "ZDSelectListController.h"

@interface ZDSelectListController ()

@end

@implementation ZDSelectListController

- (void)setupUI
{
    [super setupUI];
    
    self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.05];
    
    self.tableView.rowHeight = 40;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
    self.tableView.separatorColor = [UIColor whiteColor];
    self.tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    [self resetTablewFrame:CGRectMake(LEScreenWidth -120, 0, 90, 200)];
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"haha"];
}
- (void)loadData
{
    NSArray *data = @[@"   1 KM",@"   3 KM",@"   5 KM",@"   8 KM",@"   全 部",];
    [self.dataSource addObjectsFromArray:data];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    ZDLog(@"%s---%d---touch",__func__,__LINE__);
    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:10 inSection:1];
    [[NSNotificationCenter defaultCenter] postNotificationName:SELECT_DISTANCE_NOTIFICATION object:indexPath];
}
#pragma mark- tableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.dataSource.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"haha" forIndexPath:indexPath];
    cell.backgroundColor = LEHaxColor(0xe8e8e8);
    cell.textLabel.text = self.dataSource[indexPath.row];
    cell.textLabel.font = [UIFont systemFontOfSize:15];
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    [[NSNotificationCenter defaultCenter] postNotificationName:SELECT_DISTANCE_NOTIFICATION object:indexPath];
}


@end
